package com.sline.test;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class test3 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("aaa.txt"));

        String remainTimesStr = br.readLine();
        int remainTimes = Integer.parseInt(remainTimesStr);

        if (remainTimes > 0) {
            System.out.println("您还有" + remainTimes + "次机会");
            remainTimes = remainTimes - 1;

            FileWriter fw = new FileWriter("aaa.txt");
            fw.write(remainTimes + "");
            fw.close();
        } else {
            System.out.println("您的试用机会已经使用完毕, 请购买正版软件");
        }

        br.close();
    }
}
